<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('文章类别编辑')" />
</head>
<body>
	<section class="content">
	    <form class="form-horizontal" id="newscategoryDetailForm">
	        <input class="hidden" name="newsCategoryId" th:value="${newsCategory.newsCategoryId}">
	        <div class="box-body">
	            <div class="form-group">
	                <label class="col-sm-3 control-label">类别名称 :</label>
	                <div class="col-sm-8">
	                    <input type="text" th:value="${newsCategory.categoryName}" class="form-control" name="categoryName" required placeholder="请输入类别名称">
	                </div>
	            </div>
	            <div class="form-group">
	                <label class="col-sm-3 control-label">角色描述 :</label>
	                <div class="col-sm-8">
						<label class="radio-inline pr-5"><input type="radio" th:field="*{newsCategory.status}" name="status" value="1" checked="checked"> 有效</label>
						<label class="radio-inline pr-5"><input type="radio" th:field="*{newsCategory.status}" name="status" value="0" required> 无效</label>
	                </div>
	            </div>
	        </div>
	    </form>
    </section>
    <th:block th:include="include :: footer" />
    <script>
        function submitHandler() {
        	if(doValidForm(newscategoryDetailForm)){
                $.common.postAjax("/newsCategory/edit",$("#newscategoryDetailForm").serialize(),function (data) {
                    if(data.code == 0){
                    	parent.layer.closeAll('iframe'); // 关闭当前frame
						parent.$.table.refreshTable();
						parent.toastr.success(data.msg);
					} else {
						parent.toastr.error(data.msg);
					}
                })
            }
        }
    </script>
</body>
</html>